do not BUG() if memory cannot be allocated, just wait.
authorvhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com>
Mon, 20 Feb 2006 17:14:19 +0000 (17:14 +0000)
committervhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com>
Mon, 20 Feb 2006 17:14:19 +0000 (17:14 +0000)
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c

index 7cf316644fd33170235ddd58db2b1c7a8c93380b..dcbccfefb91a4007fb40056e8cb2d61b44b59a19 100644 (file)
@@ -726,8 +726,7 @@ static void blkif_recover(struct blkfront_info *info)
        int j;
 
        /* Stage 1: Make a safe copy of the shadow state. */
-       copy = kmalloc(sizeof(info->shadow), GFP_KERNEL);
-       BUG_ON(copy == NULL);
+       copy = kmalloc(sizeof(info->shadow), GFP_KERNEL | __GFP_NOFAIL);
        memcpy(copy, info->shadow, sizeof(info->shadow));
 
        /* Stage 2: Set up free list. */